package com.ps.dao.setting;

import java.util.List;
import org.hibernate.LockMode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.ps.dao.BaseDaoSupport;
import com.ps.pojo.setting.Permission;

/**
 * A data access object (DAO) providing persistence and search support for
 * Permission entities. Transaction control of the save(), update() and delete()
 * operations can directly support Spring container-managed transactions or they
 * can be augmented to handle user-managed Spring transactions. Each of these
 * methods provides additional information for how to configure it for the
 * desired type of transaction control.
 * 
 * @see com.ps.pojo.setting.Permission
 * @author MyEclipse Persistence Tools
 */

public class PermissionDAO extends BaseDaoSupport<Permission> {
	private static final Logger log = LoggerFactory
			.getLogger(PermissionDAO.class);
	// property constants
	public static final String NAME = "name";
	public static final String DESCRIBE = "describe";

	protected void initDao() {
		// do nothing
	}



	public List findByName(Object name) {
		return findByProperty(NAME, name);
	}

	public List findByDescribe(Object describe) {
		return findByProperty(DESCRIBE, describe);
	}



	public static PermissionDAO getFromApplicationContext(ApplicationContext ctx) {
		return (PermissionDAO) ctx.getBean("PermissionDAO");
	}
}